﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;
using System.Data.Common;
using System.Data;

namespace MySoftWare.DataAccess.DBProvider
{
    public class SqLiteProvider : IDbProvider
    {
        /// <summary>
        /// 当前数据库实例
        /// </summary>
        /// <returns></returns>
        public DbProviderFactory GetInstance()
        {
            return SQLiteFactory.Instance;
        }

        public DbParameter MakeParam(string ParamName, DbType DbType, Int32 Size)
        {
            SQLiteParameter param;

            if (Size > 0)
                param = new SQLiteParameter(ParamName, (DbType)DbType, Size);
            else
                param = new SQLiteParameter(ParamName, (DbType)DbType);

            return param;
        }

        public void DeriveParameters(IDbCommand cmd)
        {

        }

        public bool IsFullTextSearchEnabled()
        {
            return true;
        }

        public bool IsCompactDatabase()
        {
            return true;
        }

        public bool IsBackupDatabase()
        {
            return true;
        }
    }
}
